Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
chrome-runner
Advanced tools
Run chrome with ease from node.
remote-debugging-port
on an available portkill()
const {Runner,launch,launchWithoutNoise,launchWithHeadless} = require('chrome-runner');
// launch a chrome, launch return a Runner instance
const runner = await launch();
// read chrome remote debugging port
runner.port;
// kill this chrome
await runner.kill();
launch()
method can pass options by launch({name:value})
. Include:
port
: {number} launch chrome listen on debug port, default will random a free port to usechromePath
: {string} chrome executable full path, default will automatic find a path according to your system. If no executable chrome find, will use env CHROME_PATH as executable full path. If all of the above way can't get a path a Error('no chrome installations found') will throwchromeFlags
: {Array} flags pass to chrome when start chrome, all flags can be find herestartupPage
: {string} open page when chrome start, default is about:blank
shouldRestartChrome
: {boole} logger to handle log from chrome-runner, interface like console, default use consolemonitorInterval
: {number} in ms, monitor chrome is alive interval, default is 500mschromeDataDir
: {string} chrome data dir, default will create one in system tmpdisableLogging
: {boolean} Controls if Chome stdout and stderr is logged to file, default is true
.runner.port
: get chrome remove debug portrunner.kill()
: kill chrome and release all resource and remove temp filesRunner extends EventEmitter, it will emit some events in it's lifecycle, Include:
chromeAlive(port)
: when monitor detect chrome is alivechromeDead(code, signal)
: after monitor detect chrome is not alivechromeRestarted()
: after chrome unexpected exited then runner restart itchromeDataDirPrepared(chromeDataDir)
: after runner create data dir for chromechromeDataDirRemoved(chromeDataDir)
: after remove successful create data dir for chromelaunchWithoutNoise
same with launch
but disables many chrome services that add noise to automated scenarios.
launchWithHeadless
same with launch
but run chrome in headless mode and without noise.
more use case see unit test, API detail see d.ts
After chrome launched, chrome's log and pid file will be pipe to file in chromeDataDir
, Include:
chrome-out.log
chrome info logchrome-err.log
chrome error logchrome.pid
chrome pid filechrome-runner required chrome installed on your system, it easy to install on OSX and Windows, Linux server see How to install Chrome browser properly via command line?
chrome-runner has been used in many project, e.g:
FAQs
headless chrome runner launcher
The npm package chrome-runner receives a total of 8 weekly downloads. As such, chrome-runner popularity was classified as not popular.
We found that chrome-runner demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.